import React, { Component } from 'react';
import { get_nav } from '../utils/api'
import { SoundOutline } from 'antd-mobile-icons'
class Mlist extends Component {
    state = {
        navlist: []
    }

    componentDidMount() {//发送请求
        get_nav().then((res) => {
            // console.log(res.data);
            this.setState({
                navlist: res.data.list
            })
        })
    }

    render() {
        return (
            <div className='m_list'>
                <span><SoundOutline />1分抵1元。请您点击此处查看《购物须知》。</span>
                <div className='m_lists'>
                    {
                        this.state.navlist.map((item, index) => {
                            return (
                                <div className="cate" key={index}>
                                    <img src={item.pic} alt="" />
                                    <div className='name'>{item.name}</div>
                                </div>
                             )
                        })
                    }
                </div>
            </div>
        );
    }
}

export default Mlist;